class DetailData {
  DetailInfo? message;
  Meta? meta;

  DetailData({this.message, this.meta});

  DetailData.fromJson(Map<String, dynamic> json) {
    message =
        json['message'] != null ? DetailInfo.fromJson(json['message']) : null;
    meta = json['meta'] != null ? Meta.fromJson(json['meta']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (message != null) {
      data['message'] = message!.toJson();
    }
    if (meta != null) {
      data['meta'] = meta!.toJson();
    }
    return data;
  }
}

class DetailInfo {
  int? goodsId;
  int? catId;
  String? goodsName;
  int? goodsPrice;
  int? goodsNumber;
  int? goodsWeight;
  String? goodsIntroduce;
  String? goodsBigLogo;
  String? goodsSmallLogo;
  int? goodsState;
  String? isDel;
  int? addTime;
  int? updTime;
  int? deleteTime;
  int? hotMumber;
  bool? isPromote;
  int? catOneId;
  int? catTwoId;
  int? catThreeId;
  String? goodsCat;
  List<Pics>? pics;
  List<Attrs>? attrs;

  DetailInfo(
      {this.goodsId,
      this.catId,
      this.goodsName,
      this.goodsPrice,
      this.goodsNumber,
      this.goodsWeight,
      this.goodsIntroduce,
      this.goodsBigLogo,
      this.goodsSmallLogo,
      this.goodsState,
      this.isDel,
      this.addTime,
      this.updTime,
      this.deleteTime,
      this.hotMumber,
      this.isPromote,
      this.catOneId,
      this.catTwoId,
      this.catThreeId,
      this.goodsCat,
      this.pics,
      this.attrs});

  DetailInfo.fromJson(Map<String, dynamic> json) {
    goodsId = json['goods_id'];
    catId = json['cat_id'];
    goodsName = json['goods_name'];
    goodsPrice = json['goods_price'];
    goodsNumber = json['goods_number'];
    goodsWeight = json['goods_weight'];
    goodsIntroduce = json['goods_introduce'];
    goodsBigLogo = json['goods_big_logo'];
    goodsSmallLogo = json['goods_small_logo'];
    goodsState = json['goods_state'];
    isDel = json['is_del'];
    addTime = json['add_time'];
    updTime = json['upd_time'];
    deleteTime = json['delete_time'];
    hotMumber = json['hot_mumber'];
    isPromote = json['is_promote'];
    catOneId = json['cat_one_id'];
    catTwoId = json['cat_two_id'];
    catThreeId = json['cat_three_id'];
    goodsCat = json['goods_cat'];
    if (json['pics'] != null) {
      pics = <Pics>[];
      json['pics'].forEach((v) {
        pics!.add(Pics.fromJson(v));
      });
    }
    if (json['attrs'] != null) {
      attrs = <Attrs>[];
      json['attrs'].forEach((v) {
        attrs!.add(Attrs.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['goods_id'] = goodsId;
    data['cat_id'] = catId;
    data['goods_name'] = goodsName;
    data['goods_price'] = goodsPrice;
    data['goods_number'] = goodsNumber;
    data['goods_weight'] = goodsWeight;
    data['goods_introduce'] = goodsIntroduce;
    data['goods_big_logo'] = goodsBigLogo;
    data['goods_small_logo'] = goodsSmallLogo;
    data['goods_state'] = goodsState;
    data['is_del'] = isDel;
    data['add_time'] = addTime;
    data['upd_time'] = updTime;
    data['delete_time'] = deleteTime;
    data['hot_mumber'] = hotMumber;
    data['is_promote'] = isPromote;
    data['cat_one_id'] = catOneId;
    data['cat_two_id'] = catTwoId;
    data['cat_three_id'] = catThreeId;
    data['goods_cat'] = goodsCat;
    if (pics != null) {
      data['pics'] = pics!.map((v) => v.toJson()).toList();
    }
    if (attrs != null) {
      data['attrs'] = attrs!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class Pics {
  int? picsId;
  int? goodsId;
  String? picsBig;
  String? picsMid;
  String? picsSma;
  String? picsBigUrl;
  String? picsMidUrl;
  String? picsSmaUrl;

  Pics(
      {this.picsId,
      this.goodsId,
      this.picsBig,
      this.picsMid,
      this.picsSma,
      this.picsBigUrl,
      this.picsMidUrl,
      this.picsSmaUrl});

  Pics.fromJson(Map<String, dynamic> json) {
    picsId = json['pics_id'];
    goodsId = json['goods_id'];
    picsBig = json['pics_big'];
    picsMid = json['pics_mid'];
    picsSma = json['pics_sma'];
    picsBigUrl = json['pics_big_url'];
    picsMidUrl = json['pics_mid_url'];
    picsSmaUrl = json['pics_sma_url'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['pics_id'] = picsId;
    data['goods_id'] = goodsId;
    data['pics_big'] = picsBig;
    data['pics_mid'] = picsMid;
    data['pics_sma'] = picsSma;
    data['pics_big_url'] = picsBigUrl;
    data['pics_mid_url'] = picsMidUrl;
    data['pics_sma_url'] = picsSmaUrl;
    return data;
  }
}

class Attrs {
  int? goodsId;
  int? attrId;
  String? attrValue;
  int? addPrice;
  String? attrName;
  String? attrSel;
  String? attrWrite;
  String? attrVals;

  Attrs(
      {this.goodsId,
      this.attrId,
      this.attrValue,
      this.addPrice,
      this.attrName,
      this.attrSel,
      this.attrWrite,
      this.attrVals});

  Attrs.fromJson(Map<String, dynamic> json) {
    goodsId = json['goods_id'];
    attrId = json['attr_id'];
    attrValue = json['attr_value'];
    addPrice = json['add_price'];
    attrName = json['attr_name'];
    attrSel = json['attr_sel'];
    attrWrite = json['attr_write'];
    attrVals = json['attr_vals'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['goods_id'] = goodsId;
    data['attr_id'] = attrId;
    data['attr_value'] = attrValue;
    data['add_price'] = addPrice;
    data['attr_name'] = attrName;
    data['attr_sel'] = attrSel;
    data['attr_write'] = attrWrite;
    data['attr_vals'] = attrVals;
    return data;
  }
}

class Meta {
  String? msg;
  int? status;

  Meta({this.msg, this.status});

  Meta.fromJson(Map<String, dynamic> json) {
    msg = json['msg'];
    status = json['status'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['msg'] = msg;
    data['status'] = status;
    return data;
  }
}
